<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微信公众号同步助手</title>
    <link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="css/boot.css" />
    <link rel="stylesheet" href="styles.css" />
    <link rel="stylesheet" href="popup.js.css" />
    <script src="libs/jquery.js"></script>
    <script src="libs/jquery.xmlrpc.min.js"></script>
    <script src="libs/hmac-sha256.js"></script>
    <script src="libs/enc-base64-min.js"></script>
    <script src="libs/thrift/thrift.js"></script>
    <script src="libs/thrift/thrift-js-binary-protocol.js"></script>
</head>
<body>
    <div id="app"></div>
    <script src="popup.js"></script>
</body>
</html>
                        <h3>popup.js 加载失败</h3>
                        <p>请检查控制台获取更多详细信息。</p>
                    </div>
                `;
            };
            
            document.body.appendChild(script);
            enhancedLog('脚本标签已添加到DOM');
        });
        
        // 添加定期检查
        let checkCount = 0;
        let checkInterval = setInterval(() => {
            checkCount++;
            enhancedLog(`定期状态检查 #${checkCount}`, 'debug');
            checkPageStatus();
            
            // 检查popup.js是否已加载
            if (typeof window.popupLoaded !== 'undefined') {
                enhancedLog('检测到popup.js已设置加载标志', 'info');
            }
        }, 1000); // 更频繁的检查，1秒一次
        
        // 最多检查20次
        setTimeout(() => {
            clearInterval(checkInterval);
            enhancedLog('状态检查已完成，共检查' + checkCount + '次');
        }, 20000);
        
        // 添加全局标志，便于popup.js检测
        window.debugReady = true;
    </script>
</head>
<body>
    <main id="app">
        <div id="loading">
            <h3>加载中...</h3>
            <p>正在初始化扩展程序...</p>
        </div>
    </main>
</body>
</html>